// DlgStandardEquipStyle.cpp : implementation file
//

#include "stdafx.h"
#include "pdarx.h"
#include "DlgStandardEquipStyle.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgStandardEquipStyle dialog


CDlgStandardEquipStyle::CDlgStandardEquipStyle(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgStandardEquipStyle::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgStandardEquipStyle)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	::AfxSetResourceHandle(g_ARXInstance);
}


void CDlgStandardEquipStyle::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgStandardEquipStyle)
	DDX_Control(pDX, IDC_LIST1, m_stylelist);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgStandardEquipStyle, CDialog)
	//{{AFX_MSG_MAP(CDlgStandardEquipStyle)
	ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
	ON_LBN_DBLCLK(IDC_LIST1, OnDblclkList1)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgStandardEquipStyle message handlers

void CDlgStandardEquipStyle::OnOK() 
{
	this->m_iCount = m_stylelist.GetSel(0);
	
	CDialog::OnOK();
}

void CDlgStandardEquipStyle::OnSelchangeList1() 
{
	// TODO: Add your control notification handler code here
	
}

void CDlgStandardEquipStyle::OnDblclkList1() 
{
	this->m_iCount = m_stylelist.GetSel(0);
	CDialog::OnOK();
	
}

int CDlgStandardEquipStyle::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	::AfxSetResourceHandle(g_CADInstance);
	return 0;
}

BOOL CDlgStandardEquipStyle::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	for(int i = 0; i < this->m_strArray.GetSize(); i++)
	{
		this->m_stylelist.AddString(m_strArray.GetAt(i));
	}
	this->UpdateData(false);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
